package com.xxdemo.site;

import com.xxdemo.site.validation.Hostname;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class ExternalWebServerRegistryServiceImpl implements ExternalWebServerRegistryService {
    private final WebServerDetailMapper _repo;

    public ExternalWebServerRegistryServiceImpl(
            WebServerDetailMapper repository) {
        this._repo = repository;
    }

    @Override
    public Optional<WebServerDetail> queryByHostname(Hostname hostname, boolean includingDeprecatedServer) {
        return _repo.findByHostname(hostname.getValue(), includingDeprecatedServer);
    }
}
